package Week6.J0523;

import java.util.Scanner;

public class ISBN号码_xv {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        char[] s = scanner.next().toCharArray();

        int sum = 0, count = 1, n = s.length;
        for (int i = 0; i < n - 1; i++) {// 最后一个数不统计
            if (s[i] >= '0' && s[i] <= '9') {
                sum += (s[i] - '0') * count;
                count++;
            }
        }
        sum %= 11;
        if (sum == s[n - 1] - '0' || sum == 10 && s[n - 1] == 'X') {
            System.out.println("Right");
        } else {
            s[n - 1] = sum == 10 ? 'X' : (char) (sum + '0');
            for (int i = 0; i < n; i++) {
                System.out.println(s[i]);
            }
        }
    }
}
